Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: timeout process as per config #287

Merged
merged 3 commits into from
Sep 18, 2023
Merged

fix: timeout process as per config #287

merged 3 commits into from
Sep 18, 2023

Conversation

de-sh
Copy link
Contributor

@de-sh de-sh commented Sep 13, 2023

Closes #

Changes

Why?

Trials Performed

Run against stage with example tools/lock:

#!/bin/bash

echo "{ \"sequence\": 0, \"timestamp\": $(date +%s%N | cut -b1-13),\"action_id\": \"$1\", \"state\": \"Locked\", \"progress\": 100, \"errors\": [] }"

send action with name = "lock" and see the following logs:

  2023-09-13T15:16:19.508475Z  INFO uplink::base::mqtt: Action = Action { action_id: "1738", kind: "process", name: "lock", payload: "{}" }

  2023-09-13T15:16:19.508628Z  INFO uplink::base::bridge: Received action: Action { action_id: "1738", kind: "process", name: "lock", payload: "{}" }

  2023-09-13T15:16:19.508686Z  INFO uplink::base::bridge: Action response = ActionResponse { action_id: "1738", sequence: 0, timestamp: 1694618179508, state: "Received", progress: 0, errors: [], done_response: None }

  2023-09-13T15:16:19.508743Z DEBUG uplink::base::bridge::stream: Sequence number anomaly! [0, 0

  2023-09-13T15:16:19.524885Z DEBUG uplink::collector::process: Action status: ActionResponse { action_id: "1738", sequence: 0, timestamp: 1694618179523, state: "Locked", progress: 100, errors: [], done_response: None }

  2023-09-13T15:16:19.525047Z  INFO uplink::base::bridge: Action response = ActionResponse { action_id: "1738", sequence: 0, timestamp: 1694618179523, state: "Locked", progress: 100, errors: [], done_response: None }

  2023-09-13T15:16:19.525099Z DEBUG uplink::base::bridge::stream: Sequence number anomaly! [0, 0

  2023-09-13T15:16:19.525113Z  INFO uplink::collector::process: Action done!!

With 60s being default timeout, using a sleep of 2min in the same lock file will trigger timeout, even if timeout is increased to 90s, showing that the app now works according to config and not arbitrarily timeout at 10s.

  2023-09-13T15:20:01.756286Z  INFO uplink::base::mqtt: Action = Action { action_id: "1739", kind: "process", name: "lock", payload: "{}" }

  2023-09-13T15:20:01.756394Z  INFO uplink::base::bridge: Received action: Action { action_id: "1739", kind: "process", name: "lock", payload: "{}" }

  2023-09-13T15:20:01.756433Z  INFO uplink::base::bridge: Action response = ActionResponse { action_id: "1739", sequence: 0, timestamp: 1694618401756, state: "Received", progress: 0, errors: [], done_response: None }

  2023-09-13T15:20:01.756467Z DEBUG uplink::base::bridge::stream: Sequence number anomaly! [0, 0

  2023-09-13T15:20:03.757922Z DEBUG uplink::base::bridge: Flushing stream = action_status

  2023-09-13T15:20:03.758143Z DEBUG uplink::base::serializer: publishing on /tenants/demo/devices/1001/action/status with size = 98
...
  2023-09-13T15:21:01.758138Z ERROR uplink::base::bridge: Timeout waiting for action response. Action ID = 1739

  2023-09-13T15:21:01.758292Z DEBUG uplink::base::bridge::stream: Sequence number anomaly! [0, 0

  2023-09-13T15:21:03.760157Z DEBUG uplink::base::bridge: Flushing stream = action_status

  2023-09-13T15:21:03.760565Z DEBUG uplink::base::serializer: publishing on /tenants/demo/devices/1001/action/status with size = 115

@de-sh de-sh merged commit 75d2105 into main Sep 18, 2023
@de-sh de-sh deleted the timeout-process branch September 18, 2023 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants